package com.google.code.qsecurity.server.domain;

import java.util.Date;

import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.code.qsecurity.shared.UserStatus;
import com.google.code.qsecurity.shared.UserType;

@PersistenceCapable
public class User {

	@PrimaryKey
	private String email;
	
	@Persistent
	private String hashedPassword;
	
	@Persistent
	private String name;

	@Persistent
	private UserStatus status;
	
	@Persistent
	private UserType type;

	@Persistent
	private Date lastLogin;

	@Persistent
	private Date lastPasswordRequest;
	
	@Persistent
	private Integer version;

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getHashedPassword() {
		return hashedPassword;
	}

	public void setHashedPassword(String hashedPassword) {
		this.hashedPassword = hashedPassword;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public UserStatus getStatus() {
		return status;
	}

	public void setStatus(UserStatus status) {
		this.status = status;
	}

	public UserType getType() {
		return type;
	}

	public void setType(UserType type) {
		this.type = type;
	}

	public Date getLastLogin() {
		return lastLogin;
	}

	public void setLastLogin(Date lastLogin) {
		this.lastLogin = lastLogin;
	}

	public Date getLastPasswordRequest() {
		return lastPasswordRequest;
	}

	public void setLastPasswordRequest(Date lastPasswordRequest) {
		this.lastPasswordRequest = lastPasswordRequest;
	}

	public Integer getVersion() {
		return version;
	}

	void setVersion(Integer version) {
		this.version = version;
	}
	
}
